#ifndef GDN_APPLICATION_H
#define GDN_APPLICATION_H

#include <string>
#include <vector>

#include "gdn/Scene.h"
#include "gdn/Window.h"
#include "gdn/Manager.h"
#include "gdn/SoundManager.h" // Specialized manager for sound
#include "gdn/SceneManager.h" // Similar to "gdn/Manager.h", but a little different.
#include "gdn/Vector2.h"
#include "gdn/Music.h"
#include "gdn/Font.h"
#include "gdn/Image.h"
#include "gdn/Timer.h"

const float PHYSICS_FPS = 50;

namespace gdn
{
	typedef Manager< Font >  FontManager;
	typedef Manager< Image > ImageManager;
	// Sound manager is slightly specialized, because of how it works. :)
	//typedef Manager< Music > MusicManager;

	class Application
	{
		public:
			Application(); // TO DO: Get rid of this dirty hack for fixing inherited constructors.
			Application( const Vector2i& windowSize, unsigned int windowBpp, const std::string& windowTitle );
			virtual ~Application();


			virtual int Run();
			virtual void Close();


			virtual Window& GetWindow();


			virtual void AddScene( const std::string& name, Scene* scene );
			virtual void RemoveScene( const std::string& name );

			virtual bool DoesSceneExist( const std::string& name ) const;
			virtual std::vector< std::string > GetSceneList() const;
			virtual Scene* FindScene( const std::string& name ) const;

			virtual void SetActiveScene( const std::string& name );
			virtual const std::string& GetActiveSceneName() const;


			FontManager Fonts;
			ImageManager Images;
			SoundManager Sounds;
			//MusicManager Music;

		protected:
			virtual void Construct( const Vector2i& windowSize, unsigned int windowBpp, const std::string& windowTitle );
			virtual void Destruct();


			Window window;
			SceneManager scenes;
			bool isRunning;
			gdn::Timer timer;
	};
}

#endif // GDN_APPLICATION_H
